package com.xcity.game.combat.unit;

import java.util.List;

import com.alibaba.fastjson.annotation.JSONField;
import com.xcity.game.combat.CombatTeam;
import com.xcity.game.combat.buff.CombatBuff;
import com.xcity.game.combat.buff.ActionEffectListener;
import com.xcity.game.combat.listener.LifeCycleListener;
import com.xcity.game.combat.skill.CombatSkill;
import com.xcity.game.employee.Clazz;
import com.xcity.game.skill.template.SkillTemplate;

import naga.x.game.GameUnit;

/**
 * 实际战斗中的单位（主角、员工、战斗队伍）
 * @author yang.li
 *
 */
public interface CombatUnit extends CombatableBase, GameUnit, ActionEffectListener, Comparable<CombatUnit> {

	/**
	 * 加hp
	 * @param value
	 * @return
	 */
	public int addHp(int value);
	
	/**
	 * 减hp
	 * @param value
	 * @return
	 */
	public int decHp(int value);
	
	/**
	 * 加mp
	 * @param value
	 * @return
	 */
	public int addMp(int value);
	
	/**
	 * 减mp
	 * @param value
	 * @return
	 */
	public int decMp(int value);
	
	/**
	 * 检测该单位是否死亡
	 * @return
	 */
	@JSONField(serialize = false)
	public boolean isDied();
	
	@JSONField(serialize = false)
	public CombatTeam getTeam();
	
	/**
	 * team中的位置
	 * @return
	 */
	@JSONField(serialize = false)
	public int getIndex();
	
	/**
	 * @see SkillTemplate#TYPE_PASSIVE
	 * @see SkillTemplate#TYPE_ACTIVE
	 * @see SkillTemplate#TYPE_COMBINE
	 * @param type
	 * @return
	 */
	public CombatSkill findSkillByType(byte type);
	
	public List<CombatSkill> getCombatSkills();
	
	public boolean addBuff(CombatBuff buff);

	public void removeBuff(CombatBuff buff);
	
	public CombatBuff getBuff(int id);
	
	public List<CombatBuff> getBuffs();
	
	public void setLifeCycleListener(LifeCycleListener listener);
	
	public Clazz getClazz();
}
